package cn.hiapi.shopkeeper.entity.order;

import cn.hiapi.basic.entity.BasicEntity;
import cn.hiapi.basic.serializer.LongToStringSerializer;
import cn.hiapi.shopkeeper.enums.OrderLogType;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * @author AdinZ
 * @date 2023/1/1 20:12
 */
@Entity
@Table(name = "hiapi_shopkeeper_activity_order_log")
@ApiModel(description = "活动订单")
@Getter
@Setter
public class ActivityOrderLog extends BasicEntity {
    @Id
    @GeneratedValue(generator = "snowflake")
    @GenericGenerator(name = "snowflake", strategy = "cn.hiapi.basic.id.SnowflakeId")
    @JSONField(serializeUsing = LongToStringSerializer.class)
    private Long id;

    @ApiModelProperty("订单id")
    private long oid;

    @ApiModelProperty("操作员账号类型")
    private String userType;

    @ApiModelProperty("操作人")
    private long uid;

    @ApiModelProperty("操作备注")
    private String remark;


    @ApiModelProperty("操作类型")
    @Enumerated(EnumType.STRING)
    private OrderLogType type;

    /***
     * 转增交易时才有的字段
     */
    @ApiModelProperty("发送方id")
    private Long sender;

    @ApiModelProperty("接受方id")
    private Long receive;


    @ApiModelProperty("创建时间")
    private long created = System.currentTimeMillis();

    @ApiModelProperty("更新时间")
    private long updated = System.currentTimeMillis();


}
